<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
function GetAllDanhMuc($value){
    $sql = "select * from tbl_danhmuc order by SapXep asc";
    if ($value != NULL) {
        $sql = "select * from tbl_danhmuc where IDDanhMuc=".$value." order by SapXep asc";
    }
    $ext = mysql_query($sql, ConnectDB()) or die(mysql_error());
    if (mysql_num_rows($ext) > 0) {
        while ($r = mysql_fetch_array($ext)) {
            $rs[] = $r; 
        }
    } else{
        $rs = NULL;
    }
    return $rs;
}

